﻿college_dict = {};
no_choice_college = ['--请选择--',];
college_dict['计算机科学与工程学院'] = no_choice_college.concat(['软件工程', '计算机科学与技术', '智能科学与技术']);

function onCollegeChanged(college, major) {
    let college_value;
    let i;

    college_value = college.value;

    major.length = 1;

    let major_list;
    // alert(college_value);
    if (college_value === '') {
        major_list = no_choice_college;
    } else if (typeof (college_dict[college_value]) == 'undefined') {
        major_list = no_choice_college.concat([college_value + '的专业0', college_value + '的专业1']);
    } else {
        major_list = college_dict[college_value];
    }
    for (i = 0; i < major_list.length; i++) {
        major.options[i] = new Option();
        major.options[i].text = major_list[i];
        major.options[i].value = major_list[i];
    }

}